package com.heima.user.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.common.dto.ResponseResult;
import com.heima.media.service.IWmUserService;
import com.heima.user.service.IApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/login")  //注意不可 @RestController("/login")代表将来产生的web层的对象的id不是映射路径
public class LoginController {
   @Autowired
    private IApUserService apUserService;
    /**
     *app用户登录
     * @param dto 登录信息
     * @return 业务数据：data:{user:{},token:""} data是对象 包含 用户和令牌信息
     */
   @PostMapping("/login_auth")
public ResponseResult login(@RequestBody LoginDto dto){
    return apUserService.login(dto);
}


}
